home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 78 / 078.d81 / double or quits (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  7KB  |  206 lines

  1. 2 deffns(x)=int(x/13):deffnv(x)=x-13*int(x/13):ns=13:nc=52:printchr$(142)
  2. 3 jj=-1:dims(nc),x(10),y(10)     :fori=0tonc-1:s(i)=i:next
  3. 4 dima$,jj,te,i,j,x,y,va,t,su,t,j%,f,fc,fr,j9,ba,ca,k,nc,ns,su$,ch$,is,m5,pu$,pf
  4. 6 deffns(x)=int(x/13):deffnv(x)=x-13*int(x/13):ns=13:nc=52
  5. 10 goto401
  6. 20 gosub62
  7. 21 fori=1to12:ifa$=mid$(ch$,i,1)thenreturn
  8. 22 next: goto20
  9. 26 t=87:a$="251331421502421502"
  10. 27 pokef+6,96:pokef+24,15
  11. 28 fori=1to18step3
  12. 29 pokef+1,val(mid$(a$,i,2)):pokef+4,33
  13. 30 forj=1tot*val(mid$(a$,i+2,1)):next
  14. 31 pokef+4,0:next:x=5:y=15:gosub66:ifpf=1then return
  15. 32 print"[156][176][192][192][192][192][192][192][192][201][157][157][157][157][157][157][157][157][157][221]you win[221][157][157][157][157][157][157][157][157][157][202][192][192][192][192][192][192][192][203]"
  16. 33 fori=1to900:next
  17. 34 x=9:y=09:gosub66
  18. 35 print"[213][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][201]":y=10:gosub66
  19. 36 print"[221]                     [221]":y=11:gosub66
  20. 37 print "[221] 1. the challenge    [221]":y=12:gosub66
  21. 38 print "[221] 2. regular game     [221]":y=13:gosub66
  22. 39 print "[221] 3. quit to loadstar [221]":y=14:gosub66
  23. 40 print "[221]                     [221]":y=15:gosub66
  24. 41 print "[202][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][203]"
  25. 42 gosub62:ifa$<"1"ora$>"3"then42
  26. 43 return
  27. 48 t=0:t=48-c(10):x=13:y=02:gosub66
  28. 49 print"[156][213][192][192][192][192][192][192][192][192][192][192][192][192][201][157][157][157][157][157][157][157][157][157][157][157][157][157][157][221] cards left [221][157][157][157][157][157][157][157][157][157][157][157][157][157][157][221]";
  29. 50 print"            [221][157][157][157][157][157][157][157][157][157][157][157][157][157][157][202][192][192][192][192][192][192][192][192][192][192][192][192][203][145][157][157][157][157][157][157][157][157][157]";t:goto33
  30. 58 x=10:y=24:gosub66:print" please press a key [145][145][145]"
  31. 62 geta$:ifa$=""then70:return
  32. 66 poke211,x:poke214,y:sys58732:return
  33. 70 ifjj=nc-2thenjj=-1
  34. 71 jj=jj+1:j%=jj+int(rnd(0)*(nc-jj)):temp=s(jj):s(jj)=s(j%):s(j%)=temp:goto62
  35. 111 nc=52:dimva$(13),c(12),b(11,52),vb$(13):f=54272:fori=ftof+78:pokei,0:next
  36. 115 fori=0to3:reads$(i):readco$(i):next
  37. 119 fori=0to12:readva$(i):next
  38. 120 ch$="123456789fhq"
  39. 121 fori=1to10:readx(i),y(i):next
  40. 123 data"[216]","[144]","[218]","","[211]","","[193]","[144]",a,2,3,4,5,6,7,8,9,"&",j,q,k
  41. 125 data0,5,0,13,20,0,27,0,34,0,20,8,34,8,20,16,34,16,27,16
  42. 126 fori=0to3:reads1$(i):next:fori=0to12:readvb$(i):next
  43. 127 data"[162]","#","[223]","[161]","[204]","[219]","[217]","[215]","[214]","[212]","[210]","[209]","[208]","'","[207]","[206]","[205]"
  44. 129 return
  45. 134 fori=3to10:b(i,1)=s(41+i):c(i)=1: gosub900:next:gosub167
  46. 138 fori=3to10:iffnv(b(i,1))<>12 then140
  47. 139 k=k+1:b(1,k)=b(i,1):c(i)=0:gosub163:gosub900
  48. 140 next:forj=1to300
  49. 141 fc=0: fori=3to10:ifc(i)<>0then 145
  50. 142 iffnv(  s(43-fc))=12then144
  51. 143 b(i,1)=s(43-fc):c(i)=1:gosub900:fc=fc+1:goto145
  52. 144 k=k+1:b(1,k)=s(43-fc):fc=fc+1:goto143
  53. 145 next:c(1)=44:fori=0to43-fc:k=k+1:b(1,k)=s(i):next:c(2)=0
  54. 146 return
  55. 150 ifjj=nc-2thenreturn
  56. 155 jj=jj+1:j%=jj+int(rnd(0)*(nc-jj)):temp=s(jj):s(jj)=s(j%):s(j%)=temp
  57. 157 ifjj<>nc-2then155
  58. 159 return
  59. 163 x=x(1):y=y(1):   gosub66
  60. 164 print"      [157][157][157][157][157][157]      [157][157][157][157][157][157]      [157][157][157][157][157][157]      ";
  61. 165 print"[157][157][157][157][157][157]      [157][157][157][157][157][157]      [157][157][157][157][157][157]      "
  62. 166 foris=1to70:next
  63. 167 x=x(1):y=y(1):   gosub66
  64. 168 print"[176][192][192][192][192][174][157][157][157][157][157][157][221][166][164][164][167][255][157][157][157][157][157][157][221][170][172][172][171][255][157][157][157][157][157][157][221][170][172][172][171][255]";
  65. 169 print"[157][157][157][157][157][157][221][170][172][172][171][255][157][157][157][157][157][157][221][168][165][165][169][255][157][157][157][157][157][157][173][196][196][196][196][189][145][145][145][145][145][157][157][157][157][157]" :return
  66. 170 i=2:x(2)=13:gosub900:forj=1to600:next:m5=c(2):c(2)=0:gosub200:x(2)=0:c(2)=m5
  67. 174 x(2)=0:ifc(2)=0then900:return
  68. 177 i=2: ifc(2)=1thengosub900:hm=1:return
  69. 178 ifc(2)>=3then186
  70. 182 x(2)=3*c(2)-3:gosub900:x(2)=0:hm=c(2):return
  71. 186 forj=2to0step-1:x=3*j:y=y(2):gosub66
  72. 188 print"      [157][157][157][157][157][157]      [157][157][157][157][157][157]      [157][157][157][157][157][157]      ";
  73. 190 print"[157][157][157][157][157][157]      [157][157][157][157][157][157]      [157][157][157][157][157][157]      ":next:m5=c(2)
  74. 191 ifc(2)=3then193
  75. 192 x(2)=0:c(2)=m5-2:gosub200:goto194
  76. 193 x(2)=0:c(2)=m5-2:gosub900
  77. 194 forj=1to 2:x(2)=3*j:c(2)=m5-2+j:gosub900:next:c(2)=m5:x(2)=0:hm=3:return
  78. 200 ca=b(i,c(i)):su=fns(ca):va=fnv(ca):x=x(i):y=y(i):gosub66
  79. 204 pokef+24,6:pokef+5,128:pokef+4,129:fort=1to50:next:pokef+4,128:pokef+5,0
  80. 206 pokef+24,0:pokef+24,15:pokef+4,129:pokef+4,128
  81. 208 ifc(i)<>0then220
  82. 216 print"      [157][157][157][157][157][157]      [157][157][157][157][157][157]      [157][157][157][157][157][157]      ";
  83. 218 print"[157][157][157][157][157][157]      [157][157][157][157][157][157]      [157][157][157][157][157][157]      ";:return
  84. 220 print"[176][192][192][192][192][174][157][157][157][157][157][157][221]    [255][157][157][157][157][157][157][221] [166][167] [255][157][157][157][157][157][157][221] [170][171] [255]";
  85. 222 print"[157][157][157][157][157][157][221] [168][169] [255][157][157][157][157][157][157][221]    [255][157][157][157][157][157][157][173][196][196][196][196][189]
  86. 224 [141]66
  87. 227 [153]"";co$(su);va$(va);"cmd";s$(su);"";s1$(su);"cmd";vb$(va):[142]
  88. 235 x[178]3[172](hm[171]1):y[178]y(2):[141]66
  89. 239 [153]"      cmdcmdcmdcmdcmdcmd      cmdcmdcmdcmdcmdcmd      cmdcmdcmdcmdcmdcmd      ";
  90. 243 [153]"cmdcmdcmdcmdcmdcmd      cmdcmdcmdcmdcmdcmd      cmdcmdcmdcmdcmdcmd      ":[139]c(2)[178]0[167][141]200:[142]
  91. 245 x(2)[178]x[171]3:[141]900
  92. 247 [129]j[178]1[164]300:[130]: [142]
  93. 304 [151]53280,1:[151]53281,1:   [153]"load       <<< double or quits >>>   "
  94. 306 [153]" one card is dealt to each of 8 piles "
  95. 308 [153]"with the last being the foundation, f."
  96. 310 [153]"any kings dealt are replaced and put on
  97. 314 print"the bottom of the deck (1).
  98. 316 [153]:[153]" the object is to build the entire deck,";
  99. 318 [153]"other than the kings, on f in the con-
  100. 320 print"tinuous sequence a,2,4,8,3,6,q,j,9,5,10,";
  101. 322 print"7,a etc. (this is a doubling sequence
  102. 324 [153]"with 13 subtracted when the total ex-
  103. 326 print"ceeds 13.) suits are ignored.
  104. 328 [153]:[153]" cards are turned one at a time from 1
  105. 330 print"and played to 2. empty spaces [3-9] will";
  106. 332 print"be filled from 2 (1 if 2 has no cards)."
  107. 334 print"kings are dead cards, and thus any play-";
  108. 336 print"ed to [3-9] will remain there. the top "
  109. 338 print"card of [2-9] is available for play. the";
  110. 339 print"challenge allows one redeal and the
  111. 340 [153]"regular game allows two.         ":[139]j9[178]1[167]342
  112. 341 [153]:[153]"          a moment, pleaseonon";:j9[178]1:[141]150
  113. 342 [153]"onon":[141]58
  114. 343 [142]
  115. 360 [151]53280,1:[151]53281,1:[153]"load  ortantantantantantantantantantanright$
  116. 361 print"  [221]  double  [221]
  117. 362 [153]"  (NULL) or quits (NULL)
  118. 363 print"  [202][192][192][192][192][192][192][192][192][192][192][203]
  119. 364 [153]"stop         h-help
  120. 365 print"         q-quit        3      4      5
  121. 366 [153]"   1
  122. 367 print"                       6             7
  123. 368 [153]"   2
  124. 371 print"                       8      f      9";:return
  125. 372 fori=214to242:pokei,peek(i)or128:next
  126. 401 poke53272,31:poke198,0:gosub304:gosub111:
  127. 402 print"[147]":  gosub34:ifa$="3"then1000
  128. 403 pu$=a$: pf=1:gosub26:pf=0:a$=pu$
  129. 404 re=val(a$):j9=1:jj=-1:fr=0
  130. 406 k=0:jj=-1:gosub360:gosub134
  131. 408 x=8 :y=9:gosub66:print"[144]redeals[156]"re
  132. 420 ba=fnv(b(10,1))+1:     goto588
  133. 424 x=0:y=22:gosub66:print" play ? [157][157]"
  134. 426 gosub20:a$="":ifc(i)=0and(i>1andi<10)then430
  135. 427 ifi=1andc(1)=0then540
  136. 428 fr=i:onigoto460,580,580,580,580,580,580,580,580,580,440,450
  137. 430 x=0:y=22:gosub66:print"illegal ":forj=1to700:next:goto424
  138. 440 sys886:gosub304:sys907:goto4